package com.lize.threaduse;

public class testThread extends Thread {
    public static void main(String[] args) {
   //测试
        Test T1 = new Test();
        Test T2 = new Test();
        Test T3 = new Test();
        T1.start();
        T2.start();
        T3.start();
    }
}
class Test extends Thread{
    private int nums=100;
    public void run(){
        while(true){
            if(nums<=0)
                break;

            try {
                Thread.sleep(50);
                System.out.println("窗口"+Thread.currentThread().getName()+"在售票"+"剩余票数"+(--nums));
            } catch (InterruptedException e) {
                e.printStackTrace();
            }


        }

    }
}